<link rel="stylesheet" href="__CDN__/assets/addons/workorder/css/create.css">
<div class="container mt-20">
    <div id="content-container" class="container">
        <div class="row">
            <div class="col-md-3">
                {include file="common/sidenav" /}
            </div>
            <div class="col-md-9">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <h2 class="page-header">
                            提交工单
                            <a href="{:url('workorder/my')}" class="btn btn-info pull-right"><i class="fa fa-th-list"></i> 我的工单</a>
                        </h2>

                        <!--手机端的步骤条-->
                        <ol class="breadcrumb mobile_steps visible-xs">
                            <li class="{$steps == 1 ? 'active':''} {$steps > 1 ? 'after_step':''}">
                                <a href="{$category ? url('workorder/create'):'javascript:;'}">1.选择产品/服务</a>
                            </li>
                            <li class="{$steps == 2 ? 'active':''} {$steps > 2 ? 'after_step':''}">
                                <a href="{$steps == 3 ? url('index/workorder/create', ['category' => $category]):'javascript:;'}">2.推荐解决方案</a>
                            </li>
                            <li class="{$steps == 3 ? 'active':''}">
                                <a href="{$steps == 2 ? url('index/workorder/create', ['steps' => 3, 'category' => $category]):'javascript:;'}">3.创建工单</a>
                            </li>
                        </ol>

                        <!--pc端步骤条-->
                        <div class="row steps hidden-xs">
                            <div class="step_item col-sm-3 col-xs-12 {$steps == 1 ? 'action_step':''} {$steps > 1 ? 'after_step':''}">
                                <a href="{$category ? url('workorder/create'):'javascript:;'}">
                                    <div class="step_body">
                                        <span>①</span>选择产品/服务
                                    </div>
                                </a>
                            </div>
                            <div class="step_item col-sm-3 col-xs-12 {$steps == 2 ? 'action_step':''} {$steps > 2 ? 'after_step':''}">
                                <a href="{$steps == 3 ? url('index/workorder/create', ['category' => $category]):'javascript:;'}">
                                    <div class="step_body">
                                        <span>②</span>推荐解决方案
                                    </div>
                                </a>
                            </div>
                            <div class="step_item col-sm-3 col-xs-12 {$steps == 3 ? 'action_step':''}">
                                <a href="{$steps == 2 ? url('index/workorder/create', ['steps' => 3, 'category' => $category]):'javascript:;'}">
                                    <div class="step_body">
                                        <span>③</span>创建工单
                                    </div>
                                </a>
                            </div>
                            <div class="step_item col-sm-3 hidden-xs">
                                <div class="search_form pull-right">
                                    <form action="" method="get">
                                        <div class="input-group">
                                            <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                            <input type="text" class="form-control" name="keywords" value="" size="40" placeholder="{$category ? '搜索知识点':'搜索产品/服务'}"/>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>

                        <div class="hidden-xs">
                            <br/>
                        </div>

                        <div class="row xs_search_form visible-xs">
                            <div class="pull-right col-sm-4 col-xs-12">
                                <form action="" method="get">
                                    <div class="input-group">
                                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                        <input type="text" class="form-control" name="keywords" value="" size="40" placeholder="{$category ? '搜索知识点':'搜索产品/服务'}"/>
                                    </div>
                                </form>
                            </div>
                        </div>

                        {present name="category_list"}
                        <div class="row select_service">
                            {volist name="category_list" id="parent_cat"}
                            <div class="selects">
                                <h3 class="selects_title">{$parent_cat.name}</h3>
                                <ul class="select_ul">
                                    {volist name="parent_cat.child" id="child_cat" empty="<li class='select_empty'>暂时没有数据...</li>"}
                                    <li class="select_item col-sm-4 col-xs-12">
                                        <a href="{:url('workorder/create',['category' => $child_cat.id])}">
                                            <div class="item_icon">
                                                <img src="{$child_cat.logo_image}">
                                            </div>
                                            <div class="item_content">
                                                <h4 class="item_content_title"><span>{$child_cat.name}</span></h4>
                                                <p class="item_content_text">{$child_cat.desc}</p>
                                            </div>
                                        </a>
                                    </li>
                                    {/volist}
                                </ul>
                            </div>
                            {/volist}
                        </div>
                        {/present}

                        {present name="kbs"}
                        <div class="row">
                            <div class="kbs">
                                <div class="{$kbs_count > 0 ? '':'hidden'}">
                                    <h3 class="kbs_title">{$search_kbs ? '为您搜索到以下':'为您推荐以下解决率最高的'}<span class="text-info"> {$kbs_count} </span>条热门知识点，可能有您需要的答案：
                                    </h3>
                                    <div class="kbs_title_dashed"></div>
                                </div>
                                <ul class="kbs_list">
                                    {volist name="kbs" id="item" key="key" empty="<li class='select_empty'>没有更多了...</li>"}
                                    <li class="col-sm-6">
                                        <a target="_blank" href="{$item.url ? $item.url : url('workorder/kbs',['id' => $item.id, 'category' => $category])}">{$key}. {$item.title}</a>
                                    </li>
                                    {/volist}
                                </ul>
                            </div>
                            <div class="kbs_divider h-60 hidden-xs"></div>
                            <div class="kbs_divider h-20 visible-xs"></div>
                            <div class="submit_select">
                                <h3 class="kbs_title">您还可以通过以下渠道提交您的问题：</h3>
                                {volist name="submit_channel" id="channel"}
                                <div class="pading-lr-5 col-sm-6 col-sm-12">
                                    <a href="{$channel.url}">
                                        <div class="submit_select_item">
                                            <img src="{$channel.logo_image}" alt="">
                                            <div>
                                                <p class="submit_select_item_title">{$channel.title}</p>
                                                <p class="submit_select_item_text">{$channel.desc}</p>
                                            </div>
                                        </div>
                                    </a>
                                </div>
                                {/volist}
                            </div>
                        </div>
                        {/present}

                        {eq name="steps" value="3"}
                        <form action="" id="create_form" role="form" data-toggle="validator" method="post" class="form-horizontal create_form">
                            {:token()}
                            <div class="form-group">
                                <div class="control-label col-xs-12 col-sm-2">当前产品/服务</div>
                                <div class="col-xs-12 col-sm-8 create_form_text">
                                    <div>{$category_name}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="control-label col-xs-12 col-sm-2">紧急程度</div>
                                <div class="col-xs-12 col-sm-8">
                                    {volist name="urgentrank" id="urgency" key="index"}
                                    <label for="row[urgency]-{$urgency.id}" class="radio_label"><input data-desc="{$urgency.desc}" id="row[urgency]-{$urgency.id}" name="row[urgency]" type="radio" value="{$urgency.id}" {eq name="index" value="1" }checked="checked" {/eq}> {$urgency.name}</label> {/volist} {present name="urgentrank[0]['desc']"}
                                    <div class="input_notice urgency_desc">{$urgentrank[0]['desc']}</div>
                                    {/present}
                                </div>
                            </div>
                            {include file="workorder/common/fields"}
                            <div class="form-group normal-footer">
                                <label class="control-label col-xs-12 col-sm-2"></label>
                                <div class="col-xs-12 col-sm-8">
                                    <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                                    <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                                </div>
                            </div>
                        </form>
                        {/eq}

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>